package com.itheima.request.f_foward;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/songServlet")
public class SongServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        //获取请求参数
        String money = request.getParameter("money");
        System.out.println("你要借"+money+"?");

        System.out.println("我没钱");
        System.out.println("请稍等,我帮你找小束");

        //设置共享数据(借款人)
        request.setAttribute("name","陶成斌");

        //请求转发
        request.getRequestDispatcher("/shuServlet").forward(request,response);


    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request, response);
    }
}
